import axios from "axios";
import * as api from "../../api/gw/index.js";
export default function (params, callback, errFn) {
    let options = {
        method: "delete",
        // data: params,
        url: window.api.base_host + api.template_delete + '?' + 'rid='+ params.rid + '&storeCode='+  params.storeCode,
        headers: {
            sessionId: getCookie("sessionId"),
            // "Content-Type": "application/json"
        }
    }

    axios(options).then(data => {
        console.log("删除模板的返回值", data);
        if (data.status === 200 && data.data.returnCode === 1 && data.data.data[0]) {
            callback && callback(data.data.data);
        } else {
            console.log("删除失败");
            errFn && errFn(data.data.msg);
        }
    }).catch(err => {
        console.log(err, "删除失败");
        errFn && errFn();
    });

}